import {
	IsNotEmpty,
	IsString,
	IsNumber,
	IsBoolean,
	IsOptional,
} from "class-validator";

export class CreateAddressDto {
	@IsOptional()
	@IsNumber()
	userId?: number;

	@IsNotEmpty({ message: "收货人姓名不能为空" })
	@IsString()
	name: string;

	@IsNotEmpty({ message: "联系电话不能为空" })
	@IsString()
	phone: string;

	@IsNotEmpty({ message: "省份不能为空" })
	@IsString()
	province: string;

	@IsNotEmpty({ message: "城市不能为空" })
	@IsString()
	city: string;

	@IsNotEmpty({ message: "区县不能为空" })
	@IsString()
	district: string;

	@IsNotEmpty({ message: "详细地址不能为空" })
	@IsString()
	detail: string;

	@IsOptional()
	@IsBoolean()
	isDefault?: boolean;
}
